Fix snowflake stage not being deleted on error in load_file#1321
Fix snowflake stage not being deleted on error in load_file#1321
Conversation
Codecov ReportBase: 95.71% // Head: 94.99% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1321 +/- ##
==========================================
- Coverage 95.71% 94.99% -0.73%
==========================================
Files 19 71 +52
Lines 677 3315 +2638
Branches 68 382 +314
==========================================
+ Hits 648 3149 +2501
- Misses 18 102 +84
- Partials 11 64 +53
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
kaxil
left a comment
There was a problem hiding this comment.
One of the test is failing - https://github.com/astronomer/astro-sdk/actions/runs/3572950837/jobs/6007534322
| except AttributeError: | ||
| try: | ||
| rows = self.hook.run(sql_statement) | ||
| except (AttributeError, ValueError) as exe: |
There was a problem hiding this comment.
I removed the AttributeError from here. Could anyone explain to me why we are catching these?
There was a problem hiding this comment.
Tested it now its working without AttributeError
fdbff1f to
53ceb15
Compare
…r/astro-sdk into delete-snowflake-stage
Tested it without |
# Description ## What is the current behavior? Currently the snowflake stage is not being dropped incase of an exception when calling `load_file`. closes: #1262 ## What is the new behavior? Drop snowflake stage also when file load failed. ## Does this introduce a breaking change? No. ### Checklist - [x] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary Co-authored-by: rajaths010494 <rajath.srinivasaiah@astronomer.io> Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com> (cherry picked from commit 7e829af)
Description
What is the current behavior?
Currently the snowflake stage is not being dropped incase of an exception when calling
load_file.closes: #1262
What is the new behavior?
Drop snowflake stage also when file load failed.
Does this introduce a breaking change?
No.
Checklist